package com.example.Annocation.conditional;

import com.example.Annocation.commons.Person;
import com.example.Annocation.commons.Student;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

/**
 * @Description TODO
 * @Date 2024/5/14 20:44
 * @Created by houjunfeng
 */
@Configuration
public class ConditionalConfigeration {
    @Bean(name = "Student001")
    public Student getStudent(){
        return new Student("xiaoming",10,52);
    }
    @Conditional(WindowsConditional.class)
    @Bean(name="Bill")
    public Person getBill(){
        return new Person("bill",23);
    }
    @Conditional(LinuxConditional.class)
    @Bean(name="Dali")
    public Person getDali(){
        return new Person("dali",46);
    }
}
